Add swift-format config, reformat codebase, and add CI#2
Merged
Conversation
- Add a .swift-format config (4-space indentation, 120 col, collapse
blank lines to one). UseSynthesizedInitializer is disabled so the
formatter never strips the explicit public inits this library relies on.
- Apply swift format across all tracked Swift sources (Sources, Tests,
ExampleApp). Formatting only — no behavioral changes.
- Add a GitHub Actions workflow (.github/workflows/ci.yml) with two jobs:
- format: swift format lint --strict (fails on any deviation)
- build: compile the library and tests against the iOS simulator SDK,
and build the example app
Verified locally: lint is clean, and the library, tests, and example app
all build for the iOS simulator.
TestConfig.swift is gitignored (real credentials), so the test target can't compile on a fresh checkout. Generate a placeholder with dummy values before swift build --build-tests; CI only compiles the tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts a standard Swift formatter, reformats the codebase to match it, and adds CI to enforce formatting + compilation going forward.
.swift-formatconfigUses Apple's
swift format(bundled with the Swift 6 toolchain — no extra install). Config tuned to the existing repo style:UseSynthesizedInitializerdisabled — for a library, that rule would strip the explicitpublic inits (the synthesized init is onlyinternal), which would silently change the public API. A formatting PR shouldn't touch the API surface.Reformat
swift formatapplied across all tracked Swift sources (Sources,Tests,ExampleApp). Whitespace/layout only — no behavioral changes. This is the bulk of the diff (57 files).CI (
.github/workflows/ci.yml)Runs on PRs and pushes to
main, onmacos-latestwith the latest stable Xcode. Two jobs:swift format lint --strict; fails on any deviation from the committed config.swift buildtargets macOS and fails on UIKit code), then builds the example app. Compile checks only — the integration tests hit the live API, so they're not run in CI.Verified locally
swift format lint --strict→ clean (exit 0)